@echo off

echo rust setup start

echo rust set rustup mirror start

setx RUSTUP_DIST_SERVER https://rsproxy.cn 1>nul 2>nul
setx RUSTUP_UPDATE_ROOT https://rsproxy.cn/rustup 1>nul 2>nul

echo RUSTUP_DIST_SERVER https://rsproxy.cn
echo RUSTUP_UPDATE_ROOT https://rsproxy.cn/rustup

echo rust set rustup mirror end

echo rust set cargo mirror start

echo %cargo_home%

if "%cargo_home%"=="" (
    set cargo_home=%USERPROFILE%\.cargo
)

echo %cargo_home%

xcopy %~dp0template\cargo\config.toml %cargo_home%\ /s /y 1>nul 2>nul

echo set cargo mirror %cargo_home%\config.toml

echo rust set cargo mirror end

echo rust setup end
pause
